<?php 
/*
#
# SHORTCODE FOR COLUMNS
# Author : TT
# See function on theme_part/shortcode
# [one_half float=left sidebg=false alpha=false omega=false] Lorem ipsum dolor asimet[/one_half]  
*/
function tt_fullwidth($atts, $content='')
{
extract(shortcode_atts(
	array(
	  'style' => '',
	)
	,$atts));
	$output = '<div style="width:99%">'.theme_remove_autop($content).'</div>';
	return $output;
}
add_shortcode('fullwidth', 'tt_fullwidth');
function tt_one_half($atts, $content='')
{
extract(shortcode_atts(
	array(
	  'style' => '',
	)
	,$atts));
	$output = '<div class="one-half '.$style.'">'.theme_remove_autop($content).'</div>';
	return $output;
}
add_shortcode('one_half', 'tt_one_half');
function tt_one_third($atts, $content='')
{
extract(shortcode_atts(
	array(
	  'style' => '',
	)
	,$atts));
	$output = '<div class="one-third '.$style.'">'.theme_remove_autop($content).'</div>';
	return $output;	
}
add_shortcode('one_third', 'tt_one_third');
function tt_two_third($atts, $content='')
{
extract(shortcode_atts(
	array(
	  'style' => '',
	)
	,$atts));
	$output = '<div class="two-third '.$style.'">'.theme_remove_autop($content).'</div>';
	return $output;	
}
add_shortcode('two_third', 'tt_two_third');
function tt_one_fourth($atts, $content='')
{
extract(shortcode_atts(
	array(
	  'style' => '',
	)
	,$atts));
	$output = '<div class="one-fourth '.$style.'">'.theme_remove_autop($content).'</div>';
	return $output;	
}
add_shortcode('one_fourth', 'tt_one_fourth');
function tt_one_fifth($atts, $content='')
{
extract(shortcode_atts(
	array(
	  'style' => '',
	)
	,$atts));
	$output = '<div class="one-fifth '.$style.'">'.theme_remove_autop($content).'</div>';
	return $output;	
}
add_shortcode('one_fifth', 'tt_one_fifth');
function tt_one_sixth($atts, $content='')
{
extract(shortcode_atts(
	array(
	  'style' => '',
	)
	,$atts));
	$output = '<div class="one-sixth '.$style.'">'.theme_remove_autop($content).'</div>';
	return $output;	
}
add_shortcode('one_sixth', 'tt_one_sixth');
function tt_three_fourth($atts, $content='')
{
extract(shortcode_atts(
	array(
	  'style' => '',
	)
	,$atts));
	$output = '<div class="three-fourth '.$style.'">'.theme_remove_autop($content).'</div>';
	return $output;	
}
add_shortcode('three_fourth', 'tt_three_fourth');

/*
#
#END OF COLUMNS
#SPERATOR
#
*/

/*
* ----------------------------------------------------------------------------------------------------
* SHORTCODE FOR HTML
* @PACKAGE BY TT


H1,H2,H3,H4,H5,H6
BR,separator,inner

* ----------------------------------------------------------------------------------------------------
*/

add_shortcode('h1', 'tt_sc_h1');
add_shortcode('h2', 'tt_sc_h2');
add_shortcode('h3', 'tt_sc_h3');
add_shortcode('h4', 'tt_sc_h4');
add_shortcode('h5', 'tt_sc_h5');
add_shortcode('h6', 'tt_sc_h6');
add_shortcode('br', 'tt_sc_br');
add_shortcode('clear', 'tt_sc_clear');
add_shortcode('p', 'tt_sc_p');
add_shortcode('code', 'tt_sc_code');

/***************************************************************************
 * Add shortcode [seperator][/seperator]
***************************************************************************/
function tt_seperator($atts, $content = null)
{
	$output='<div class="seperator">
        <img alt="" src="'.SKIN_URI.'/star_bg.png">
        </div>';
    return $output;
}
add_shortcode('seperator','tt_seperator');
/***************************************************************************
 * Add shortcode [clear][/clear]
***************************************************************************/
add_shortcode('clear','tt_sc_clear');
function tt_sc_clear($atts, $content = null)
{

    $output = '<div class="clearfix">&nbsp;</div>'."\n";
    return $output;
}
/***************************************************************************
 * Add shortcode [code][/code]
***************************************************************************/
function tt_sc_code($atts, $content = null)
{

    $output = '<code>'.theme_remove_autop($content).'    </code>'."\n";
    return $output;
}
/***************************************************************************
 * Add shortcode [H1][/H1]
***************************************************************************/
function tt_sc_h1($atts, $content = null)
{

    $output = '<h1>'.theme_remove_autop($content).'</h1>'."\n";
    return $output;
}
/***************************************************************************
 * Add shortcode [p][/p]
***************************************************************************/
function tt_sc_p($atts, $content = null)
{

    $output = '<p>'.theme_remove_autop($content).'</p>'."\n";
    return $output;
}
/***************************************************************************
 * Add shortcode [H2][/H2]
***************************************************************************/
function tt_sc_h2($atts, $content = null)
{

    $output = '<h2>'.theme_remove_autop($content).'</h2>'."\n";
    return $output;
}
/***************************************************************************
 * Add shortcode [H3][/H3]
***************************************************************************/
function tt_sc_h3($atts, $content = null)
{

    $output = '<h3>'.theme_remove_autop($content).'</h3>'."\n";
    return $output;
}
/***************************************************************************
 * Add shortcode [H4][/H4]
***************************************************************************/
function tt_sc_h4($atts, $content = null)
{

    $output = '<h4>'.theme_remove_autop($content).'</h4>'."\n";
    return $output;
}
/***************************************************************************
 * Add shortcode [H5][/H5]
***************************************************************************/
function tt_sc_h5($atts, $content = null)
{

    $output = '<h5>'.theme_remove_autop($content).'</h5>'."\n";
    return $output;
}
/***************************************************************************
 * Add shortcode [H6][/H6]
***************************************************************************/
function tt_sc_h6($atts, $content = null)
{

    $output = '<h6>'.theme_remove_autop($content).'</h6>'."\n";
    return $output;
}
/***************************************************************************
 * Add shortcode [BR][/BR]
***************************************************************************/
function tt_sc_br($atts, $content = null)
{

    $output = '<br />';
    return $output;
}
/***************************************************************************
 * Add shortcode [PRE][/PRE]
***************************************************************************/

function pre_func($atts, $content) {
	
	$return_html = '<pre>'.strip_tags(theme_remove_autop($content)).'</pre>'."\n";
	
	return $return_html;
}
add_shortcode('pre', 'pre_func');
/***************************************************************************
 * Add shortcode [right_inner][/right_inner]
***************************************************************************/
function tt_sc_right_inner($atts, $content = null)
{
    $output = '<div class="right-inner">'.theme_remove_autop($content).'</div>'."\n";
    return $output;
}
add_shortcode('content', 'tt_sc_right_inner');
/***************************************************************************
 * Add shortcode [introbox][/introbox]
***************************************************************************/
function tt_sc_head($atts, $content = null)
{
    $output = '<h2 class="head">'.theme_remove_autop($content).'</h2>'."\n";
    return $output;
}
add_shortcode('head', 'tt_sc_head');
/***************************************************************************
* Add shortcode [services style=1 icon=][/List]
* @Author : Vuong Thanh 
***************************************************************************/
function tt_sc_services($atts, $content = null)
{
	 extract(shortcode_atts(
     array(
    	 'style' => 'bigicon',
         'icon' => '',
		 'title' => '',
     ),$atts));
	$output = '';
	if($style == 'bigicon'):
	$output = '
	<div class="speciality-wrap">
        <img alt="" src="'.$icon.'">
        <h2 class="team-members">'.$title.'</h2>
        <p>'.$content.'</p>
    </div>';
	endif;
    return $output;
}
add_shortcode('services', 'tt_sc_services');


/***************************************************************************
* Add shortcode [List type= color=][/List]
* @Author : Vuong Thanh 
***************************************************************************/

function tt_sc_list($atts, $content = null)
{
 		 extract(shortcode_atts(
		 array(
			 'style' => '',
			 'title' =>''
		 ),$atts));
	    $output = '<div class="client-list">';
		if($title <> ''){ $output.= '<h2>'.$title.'</h2>';};
		$output.='<ul class='.$style.'-style>'.theme_remove_autop($content).'</ul></div>'."\n";
		 return $output;
}
add_shortcode('list', 'tt_sc_list');
function tt_sc_listicon($atts, $content = null)
{
 		 extract(shortcode_atts(
		 array(
			 'icon' => '',
		 ),$atts));
		global $icon_li;
		$icon_li = $icon; 
	    $output = '<div class="client-list"><ul>'.theme_remove_autop($content).'</ul></div>'."\n";
		
    	 return $output;
}
add_shortcode('listicon', 'tt_sc_listicon');

/***************************************************************************
* Add shortcode [List item][/List]
* @Author : Vuong Thanh 
***************************************************************************/

function tt_sc_list_item($atts, $content =null)
{
 		 global $icon_li;
		 $output='';
		 if($icon_li <> '')
		 {
		 $output = '    <li style="background:url('.$icon_li.') no-repeat 0 3px;padding-left:20px;">'."\n";
		 $output.= theme_remove_autop($content);
		 $output.= '</li>'."\n";
		 }else
		 {
		 $output = '    <li>'."\n";
		 $output.= theme_remove_autop($content);
		 $output.= '</li>'."\n";
		 }
		 return $output;
}

add_shortcode('li', 'tt_sc_list_item');

/***************************************************************************
* Add shortcode [Blogquote][/Blogquote]
* @Author : Vuong Thanh 
***************************************************************************/
function tt_sc_blockquote($atts, $content =null)
{
 		 wp_enqueue_script('quovolver');
		 $output = '<div class="about-quote">'."\n";
		 $output.= theme_remove_autop($content);
		 $output.= '</div>'."\n";
		 return $output;
}
add_shortcode('blockquote', 'tt_sc_blockquote');

/***************************************************************************
* Add shortcode [Testermonial style=auto include=][/Testermonial]
* @Author : Vuong Thanh 
***************************************************************************/
function tt_sc_testermonial($atts, $content =null)
{
		 return $output;
}
add_shortcode('testermonial', 'tt_sc_testermonial');

/***************************************************************************
* Add shortcode [button color= ][/button]
* @Author : Vuong Thanh 
***************************************************************************/
function tt_sc_button($atts,$content=null)
{
 		 extract(
		 shortcode_atts(
		 	array(
				'href' => '',
				'color' => 'orange',
				'lightbox_image' =>'',
			),$atts));

		$output = '    <a class="button '.$color.'" href="'.$href.'">'."\n";
		if($href==''){
		$output = '    <a class="button '.$color.'">'."\n";
		}	
		if($lightbox_image <> '')
		{
		$output = '<a class="button '.$color.'" title="Title goes here" href="'.$lightbox_image.'" rel="prettyPhoto">'."\n";
		}
		$output .= theme_remove_autop($content);
		$output .= '</a>'."\n";	
		return $output;		
}
add_shortcode('button', 'tt_sc_button');

/***************************************************************************
* Add shortcode [table color=][/table]
* @Author : Vuong Thanh 
***************************************************************************/
function tt_sc_table($atts,$content=null)
{
 		 extract(
		 shortcode_atts(
		 	array(
				'color' => '',
			),$atts));
		$output = '    <table class="feature-table '.$color.'">'."\n";	
		$output .= theme_remove_autop($content);
		$output .= '</table>'."\n";	
		return $output;			
}
add_shortcode('table', 'tt_sc_table');

/***************************************************************************
* Add shortcode [Image color=][/Image]
* @Author : Vuong Thanh 
***************************************************************************/

function tt_sc_image($atts,$content=null)
{
 		 extract(
		 shortcode_atts(
		 	array(
				'style' => 'left',
				'border' => '',
				'lightbox' => 'false',
				'src' => '',
				'alt' => '',
			),$atts));
		$hw='w=194&amp;h=148';
		$style_img='';
		if($border == "border1")
		{
		$style_img='style="background: url('.IMAGE_URI.'/color/green/home_blog.png) no-repeat scroll center bottom transparent;
        padding: 0 0 11px;
        position: relative;"';
		}
		else{
		$style_img='style="background: url('.IMAGE_URI.'/color/green/home_portfolio.png) no-repeat scroll 0 0 transparent;
        float: left;
        margin: 0 16px 27px 0;
        padding: 0 11px;"';
		};
		if($lightbox == 'true') :
    		$output = '    <a class="img_frame" href="'.$src.'" rel="prettyPhoto"><div '.$style_img.'><img src="'.THEME_URI.'/timthumb.php?src='.$src.'&amp;'.$hw.'&amp;zc=1" alt="'.$alt.'" style="border:1px solid #fff;"/></div></a>'."\n";	
		else:
    		$output = '    <div '.$style_img.'><img src="'.THEME_URI.'/timthumb.php?src='.$src.'&amp;'.$hw.'&amp;zc=1" alt="'.$alt.'" style="border:1px solid #fff;"/></div>'."\n";
		endif;
		return $output;			
}
add_shortcode('image', 'tt_sc_image');

/***************************************************************************
* Add shortcode [Image_cation color=][/Image]
* @Author : Vuong Thanh 
***************************************************************************/
function tt_sc_image_caption($atts,$content=null)
{
 		 extract(
		 shortcode_atts(
		 	array(
				'style' => 'frame_center',
				'title' => '',
				'src' => '',
				'alt' => '',
				'lightbox' => 'false',
			),$atts));
		$output='';
		if($style == 'frame_left'):
		$div_start='<div class="frame_left">';
		$hw = 'h=131&amp;w=180';
		elseif($style == 'frame_right'):
		$div_start='<div class="frame_right">';
		$hw = 'h=131&amp;w=180';
		elseif($style == 'frame_center'):
		$div_start='<div class="frame_center">';
		$hw = 'h=257&amp;w=663';
		endif;
		if($lightbox == 'true'):
		$output =$div_start.'
			 <a class="img_frame" href="'.$src.'" rel="prettyPhoto">
			 	<img src="'.THEME_URI.'/timthumb.php?src='.$src.'&amp;'.$hw.'&amp;zc=1" alt="" />
			 </a>
			 <span class="caption">'.$title.'</span>
		</div>';
		else:
		$output =$div_start.'
			 <a class="img_frame">
			 	<img src='.THEME_URI.'/timthumb.php?src='.$src.'&amp;'.$hw.'&amp;zc=1" alt="" />
			 </a>
			 <span class="caption">'.$title.'</span>
		</div>';
		endif;
		return $output;			
}
add_shortcode('image_caption', 'tt_sc_image_caption');

/***************************************************************************
* Add shortcode [table color=][/table]
* @Author : Vuong Thanh 
***************************************************************************/
function tt_sc_dropcap($atts,$content=null)
{
 		 extract(
		 shortcode_atts(
		 	array(
				'style' => 'dropcap1',

			),$atts));
		$output = '    <span class="'.$style.'">'.theme_remove_autop($content).'</span>'."\n";	
		return $output;			
}
add_shortcode('dropcap', 'tt_sc_dropcap');

/***************************************************************************
* Add shortcode [tabs tab1= tab2= tab3= tab4= tab5= current=][/button]
* @Author : Vuong Thanh 
***************************************************************************/
function tt_sc_tabs($atts,$content=null)
{
 	global $tabs_array, $tabs_li_count, $tabs_pane_count;
	$tabs_li_count = 0;
	$tabs_pane_count = 0;

	do_shortcode( theme_remove_autop($content) );

	if( is_array( $tabs_array ) )
	{

		$output = '    <div class="tabs">'."\n";
		$output .= '        <ul class="tabs-control">'."\n";
		$tabs_pane_count=0;
		foreach( $tabs_array as $tab )
		{
			$tabs_li_count++;
			if($tabs_li_count == '1') 
			{
				$output .= '            <li><a href="#tab-'.$tabs_li_count.'">' . $tab['title'] . '</a></li>'."\n";
			}
			else
			{
				$output .= '            <li><a href="#tab-'.$tabs_li_count.'">' . $tab['title'] . '</a></li>'."\n";
			}
		}
		
		$output .= '        </ul>'."\n";
		$output .= '    <div class="tabs-tabs">'."\n";
		
		foreach( $tabs_array as $tab )
		{
			$tabs_pane_count++;
			$output .= '<div class="tabs-tab tab-'.$tabs_pane_count.'"><p>' .theme_remove_autop($tab['content']).'</p></div>'."\n";
		}

		$output .= '</div>'."\n";		
		$output .= '</div>'."\n";
		
		return $output;
	}
}
add_shortcode('tabs', 'tt_sc_tabs');

/***************************************************************************
 * Add shortcode [tab] [/tab]
***************************************************************************/
function tt_sc_tab( $atts, $content = null)
{
	global $tabs_array;
	
	extract(shortcode_atts(array(
		'title' => 'Title goes here'
	), $atts));
	
	$tabs_array[] = array(
		'title' => $title,
		'content' =>  theme_remove_autop($content) 
	);
}

add_shortcode('tab', 'tt_sc_tab');



/***************************************************************************
 * Add shortcode [toggle] [/toggle]
***************************************************************************/
function tt_sc_toggle($atts, $content=null)
{	
	global $toggles_array;
	
	extract(shortcode_atts(array(
		'title' => 'Title goes here',
		'active' =>'false',
	), $atts));
	
	$toggles_array[] = array(
		'title' => $title,
		'content' => do_shortcode($content),
		'active' =>$active
	);
}
add_shortcode('toggle', 'tt_sc_toggle');

/***************************************************************************
 * Add shortcode [toggles] [/toggles]
***************************************************************************/
function tt_sc_toggles( $atts, $content = null)
{

	global $toggles_array;
	theme_remove_autop($content);
	$output='';
	$output = '<div class="accordion">'."\n";
	if( is_array( $toggles_array ) ):
		foreach( $toggles_array as $toggle ):
			if($toggle['active']=='true'):
			$output .= '    <div class="toggle active">'."\n";
    			$output .= '        <div class="toggle-title"><span class="indicator"></span>'.$toggle['title'].'</div>'."\n";
    			$output .= '        <div class="toggle-body">'.theme_remove_autop($toggle['content']).'</div>'."\n";
			$output    .= '    </div>'."\n";		
			else:
			$output .= '    <div class="toggle">'."\n";
    			$output .= '        <div class="toggle-title"><span class="indicator"></span>'.$toggle['title'].'</div>'."\n";
    			$output .= '        <div class="toggle-body">'.theme_remove_autop($toggle['content']).'</div>'."\n";
			$output    .= '    </div>'."\n";			
			endif;
		endforeach;
	endif;
	$output .= '</div>';	
	return $output;
}
add_shortcode('toggles', 'tt_sc_toggles');




/***************************************************************************
 * Add shortcode [accordion] [/accordion]
***************************************************************************/
function tt_sc_accordion($atts, $content=null)
{	
	global $accordion_array;
	
	extract(shortcode_atts(array(
		'title' => 'Title goes here',
		'active' =>'false',
	), $atts));
	
	$accordion_array[] = array(
		'title' => $title,
		'content' => theme_remove_autop($content),
		'active' =>$active
	);
}
add_shortcode('accordion', 'tt_sc_accordion');

/***************************************************************************
 * Add shortcode [accordion] [/accordion]
***************************************************************************/
function tt_sc_accordions( $atts, $content = null)
{

	global $accordion_array;
	theme_remove_autop($content);
	
	if( is_array( $accordion_array ) )
	{
	    $output = '    <div class="accordion">'."\n";
		foreach( $accordion_array as $accordion )
		{
			if($accordion['active']=='true'){
			$output .= '        <div class="accordion-panel active">';
			$output .= '            <div class="accordion-panel-title"><span class="indicator"></span>'.$accordion['title'].'</div>'."\n";
			$output .= '            <div class="accordion-panel-body">'
                                .theme_remove_autop($accordion['content']).
                            '            </div>';
			$output .= '        </div>'."\n";				
			}
			else{
						$output .= '        <div class="accordion-panel">';
			$output .= '            <div class="accordion-panel-title"><span class="indicator"></span>'.$accordion['title'].'</div>';
			$output .= '            <div class="accordion-panel-body" style="display: none;">'
                                .theme_remove_autop($accordion['content']).
                            '            </div>'."\n";
			$output .= '        </div>'."\n";							
			}
		}
		$output .= '    </div>'."\n";
		return $output;	
	}
}
add_shortcode('accordions', 'tt_sc_accordions');

/***************************************************************************
 * Add shortcode [info style=] [/toggles]
***************************************************************************/
function tt_sc_info( $atts, $content = null)
{
 extract(shortcode_atts(array(
 'style' => 'info'
 ),$atts));
 $output = '<div class="info '.$style.'">'."\n";
 $output .= theme_remove_autop($content);
 $output .= '</div>'."\n";
 return $output;
}
add_shortcode('info', 'tt_sc_info');
/***************************************************************************
 * Add shortcode [highlight color=] [/highlight]
***************************************************************************/
function tt_sc_highlight( $atts, $content = null)
{
 extract(shortcode_atts(array(
 'color' => ''
 ),$atts));
 $output = '    <span class="highlight '.$color.'">'."\n";
 $output .= theme_remove_autop($content);
 $output .= '    </span>'."\n";
 return $output;
}
add_shortcode('highlight', 'tt_sc_highlight');
/***************************************************************************

***************************************************************************/
function tt_sc_testimonial( $atts, $content = null)
{
 extract(shortcode_atts(array(
 'title' => '',
 'num_of_post' => '3',
 ),$atts));
 wp_enqueue_script('quovolver');
 $output = TT_testmonial($title,$num_of_post);
 return $output;
}
add_shortcode('testimonial', 'tt_sc_testimonial');
/***************************************************************************
 * Add shortcode [twitter title= name=fdfdf user=] [/twitter]
***************************************************************************/
function tt_sc_twitter( $atts, $content = null)
{
 extract(shortcode_atts(array(
 'title' => '',
 'username' => '',
 'boxname' => '',
 'count' => '3',
 
 ),$atts));
 wp_enqueue_script('tweet');
 $output = TT_twitter($title,$username,$boxname,$count);
 return $output;
}
add_shortcode('twitter', 'tt_sc_twitter');




/***************************************************************************
 * Add shortcode [LastedPost color=] [/LastedPost]
 tt_get_post($type='lasted',$title='',$enable_title='true',$readmore='',$enable_desc='true',$num_of_post='6',$sort='')
***************************************************************************/
function tt_sc_lastedPost( $atts, $content = null)
{
 extract(shortcode_atts(array(
  'title' => 'Lasted Post',
  'enable_title' => 'true',
  'readmore' => '',
  'enable_desc' => 'true',
  'num_of_post' => '',
  'sort' => '',
  'type' => 'lasted',
 ),$atts));
  return tt_get_post($type,$title,$enable_title,$readmore,$enable_desc,$num_of_post,$sort);
}
add_shortcode('lastedpost', 'tt_sc_lastedPost');


/***************************************************************************
 * Add shortcode [PopularPost color=] [/PopularPost]
***************************************************************************/
function tt_sc_popularPost( $atts, $content = null)
{
 extract(shortcode_atts(array(
  'title' => 'Lasted Post',
  'enable_title' => 'true',
  'readmore' => '',
  'enable_desc' => 'true',
  'num_of_post' => '',
  'sort' => '',
  'type' => 'lasted',
 ),$atts));
  return tt_get_post($type,$title,$enable_title,$readmore,$enable_desc,$num_of_post,$sort);
}
add_shortcode('popularpost', 'tt_sc_popularPost');

/***************************************************************************
 * Add shortcode [getproject_1] [/getproject_1]
***************************************************************************/
function tt_sc_GetProject( $atts, $content = null)
{
//get_postfolio($type='lasted',$title='',$enable_title='true',$readmore='',$enable_desc='true',$num_of_post='6',$sort='')
 extract(shortcode_atts(array(
  'num_of_post' => '',
  'enable_title' => 'true',
  'enable_desc' => 'true',
  'readmore' => get_theme_option('portfolio','portfolio_readmore_link'),
  'type' => 'lasted',
  'title' => 'Lasted Project',
  'sort' =>''
 ),$atts));
  return get_postfolio($type,$title,$enable_title,$readmore,$enable_desc,$num_of_post,$sort);
}
add_shortcode('getproject_1', 'tt_sc_GetProject');


/***************************************************************************
 * Add shortcode [getproject_2] [/getproject_2]
***************************************************************************/
function tt_sc_GetProject_2( $atts, $content = null)
{
//get_portfolio_2($type='lasted',$title='',$num_of_post='6',$light_box='',$sort='')
 extract(shortcode_atts(array(
  'num_of_post' => get_theme_option('portfolio','portfolio_single_number_related_post'),
  'light_box' => get_theme_option('portfolio','portfolio_enable_lightbox_related'),
  'type' => 'lasted',
  'title' => 'Lasted Project',
  'sort' =>''
 ),$atts));
  return get_portfolio_2($type,$title,$num_of_post,$light_box,$sort);
}
add_shortcode('getproject_2', 'tt_sc_GetProject_2');


/***************************************************************************
 * Add shortcode [relasted_portfolio] [/relasted_portfolio]
 * Only using on singgle portfolio
 relasted_portfolio_style_1($title='',$num_of_post='6',$light_box='',$sort='')
***************************************************************************/
function tt_sc_relasted_portfolio( $atts, $content = null)
{
extract(shortcode_atts(array(
   'title' => 'Relasted Project',
   'num_of_post' => '',
   'light_box'=> '',
   'sort' => '',
   'num_of_post' => '4',
   ),$atts));
   return relasted_portfolio_style_1($title,$num_of_post,$light_box,$sort);
}
add_shortcode('relasted_portfolio', 'tt_sc_relasted_portfolio');

/***************************************************************************
 * Add shortcode [relasted_portfolio] [/relasted_portfolio]
 * Only using on singgle portfolio
relasted_portfolio_style_2($title='',$enable_title='true',$readmore='',$enable_desc='true',$num_of_post='6',$sort='')
***************************************************************************/
function tt_sc_relasted_portfolio_2( $atts, $content = null)
{
extract(shortcode_atts(array(
   'title' => 'Relasted Project',
   'enable_title' => '',
   'readmore'=> '',
   'enable_desc' => '',
   'num_of_post' => '4',
   'sort' =>''
   ),$atts));
   return relasted_portfolio_style_2($title,$enable_title,$readmore,$enable_desc,$num_of_post,$sort);
}
add_shortcode('relasted_portfolio_2', 'tt_sc_relasted_portfolio_2');


/*
* Google Map
*/
function tt_sc_google_map( $atts, $content = null)
{
 extract(shortcode_atts(array(
 'name' => '',
 'type' => 'ROADMAP',
 'width' => '640',
 'height' => '300',
 'lat' => '13.782069',
 'lon' => '100.48645',
 'address' => 'Ha Noi, Viet Nam',
 'zoom' => '10',
 'popup' => 'Ha Noi, Viet Nam',
 ),$atts));
  wp_enqueue_script('google_map');
  wp_enqueue_script('gmap');
  $tt_gmap='';
  $tt_gmap = (($lat <> '')? $tt_gmap.'latitude:'.$lat.',' : $tt_gmap);
  $tt_gmap = (($lon <> '')? $tt_gmap.'longitude:'.$lon.',' : $tt_gmap);
  $tt_gmap = (($address <> '')? $tt_gmap.'address:"'.$address.'",' : $tt_gmap);
  $tt_gmap = (($popup <> '')? $tt_gmap.'popup:false'.',' : $tt_gmap);
  $tt_gmap = (($popup <> '')? $tt_gmap.'html:"'.$popup.'",' : $tt_gmap);
  $tt_gmap=substr($tt_gmap,0,-1);
  $output ='';
//[map type="MapTypeId.ROADMAP" width="640" height="300" address="Bangkok, Thailand" zoom="10" popup="Bangkok, Thailand"]
  $output.= '    <div class="google_map" id="gmap_'.md5($name).'" style="width:'.$width.'px;height:'.$height.'px;"></div>';
  $output.= '<script>jQuery("#gmap_'.md5($name).'").ready( function(){ jQuery("#gmap_'.md5($name).'").gMap({markers: [ { '.$tt_gmap.'} ], maptype: google.maps.MapTypeId.'.$type.',zoom: '.$zoom.'}); });
  </script>';
  return $output;
}
add_shortcode('google_map', 'tt_sc_google_map');
/*
* Youtube + vimeo + Embed
*/
function tt_sc_video( $atts, $content = null)
{
		 extract(shortcode_atts(array(
		 'style' => 'youtube',
		 'id' => '17207843',
		 'width' => '640',
		 'height' => '360',
		 'embedcode' =>'',
		 ),$atts));
		 
		 if($style == 'youtube'):
		 $output = '    <p><iframe title="YouTube video player" width="'.$width.'" height="'.$height.'" src=http://www.youtube.com/embed/'.$id.' frameborder="0" allowfullscreen></iframe></p>';
		 elseif ($style == 'vimeo'):
		 $output = '    <p><iframe src=http://player.vimeo.com/video/'.$id.'?title=0&amp;byline=0&amp;portrait=0 width="'.$width.'" height="'.$height.'" frameborder="0"></iframe></p>';
		 elseif ($style == 'embed' ):
 		 $output='    <p>'.$embedcode.'</p>';
		 elseif($video == '' ):;
		 endif;
		 return $output;
}
add_shortcode('video','tt_sc_video');
/*
* HTML5 VIDEO
*/
function tt_sc_html5video( $atts, $content = null)
{
		 extract(shortcode_atts(array(
		 'id' => 'video1',
		 'image' => '',
		 'mp4' => '',
		 'webm' => '',
		 'ogg' => '',
		 'width' => '640',
		 'height' => '360',
		 ),$atts));
		 
		$output = ' 
                      <video id="video_'.md5($id).'" class="video-js" width="'.$width.'" height="'.$height.'" controls="controls" preload="auto" poster="'.$image.'"><br />
                        <source src="'.$mp4.'" type=\'video/mp4; codecs="avc1.42E01E, mp4a.40.2"\' /><br />
                        <source src="'.$webm.'" type=\'video/webm; codecs="vp8, vorbis"\' /><br />
                        <source src="'.$ogg.'" type=\'video/ogg; codecs="theora, vorbis"\' /><br />
                        <object id="flash_fallback_1" class="vjs-flash-fallback" width="'.$width.'" height="'.$height.'" type="application/x-shockwave-flash" /><br />
                          data=&#8221;http://releases.flowplayer.org/swf/flowplayer-3.2.1.swf&#8221;><param name="movie" value="http://releases.flowplayer.org/swf/flowplayer-3.2.1.swf" /><param name="allowfullscreen" value="true" /><param name="flashvars" value=\'config={"playlist":["'.$image.'", {"url": "'.$mp4.'","autoPlay":false,"autoBuffering":true}]}\' /><img src="'.$image.'" width="'.$width.'" height="'.$height.'" alt="Poster Image"<br />
                            title=&#8221;No video playback capabilities.&#8221; /><br />
                        </object><br />
                      </video>
                    ';
		 return $output;
}
add_shortcode('html5video','tt_sc_html5video');

/*
* TEAM SHORTCODE
*/
function tt_sc_team( $atts, $content = null)
{
extract(shortcode_atts(
array(
   'name' => '',
   'aboutname' => '',
   'image' =>'',
   'facebook' => '',
   'twitter' => ''
),$atts
));
  wp_enqueue_script('prettyPhoto');
  $output = 
   	   		 	'<div class="team-wrap">
                    	<div class="team-shadow">
                        	<div class="team-face">
                                <img alt="Team Members" src="'.get_bloginfo( 'stylesheet_directory' ).'/timthumb.php?src='.$image.'&amp;h=106&amp;w=90&amp;zc=1" />
                            </div>
                        </div>
                        <h4>'.$name.' <span>( '.$aboutname.' )</span></h4>
                        <div class="small-spacer">&nbsp;</div>
                        <p>'.theme_remove_autop($content).'</p>
                        <p class="team-social"><a title="Facebook" class="facebook tipsy" href="'.$facebook.'">Facebook</a><a class="twitter tipsy" href="'.$twitter.'" original-title="Twitter">Twitter</a></p>
                    </div>';
	return $output;
}
add_shortcode('team','tt_sc_team');

//add xiaoming 2012-09-20

/***************************************************************************
 * Add shortcode [LastedPost color=] [/LastedPost]
 tt_get_post($type='lasted',$title='',$enable_title='true',$readmore='',$enable_desc='true',$num_of_post='6',$sort='')
***************************************************************************/
function tt_sc_vedette( $atts, $content = null)
{
 extract(shortcode_atts(array(
  'title' => 'Lasted Post',
  'enable_title' => 'true',
  'readmore' => '',
  'enable_desc' => 'true',
  'num_of_post' => '',
  'sort' => '',
  'type' => 'vedette',
 ),$atts));
  return tt_get_post_vedette($type,$title,$enable_title,$readmore,$enable_desc,$num_of_post,$sort);
}
add_shortcode('vedettepost', 'tt_sc_vedette');

?>